import { domainService } from '~/config/server'
import { NetService } from '~/utils/net.service'
import { Inject, Debounce } from "~/core/decorator";
import { Service } from "~/core/service"

export class CommissionStrategyService extends Service {

  @Inject(NetService)
  private netService: NetService

  /**
   * 委外佣金策略列表
   */
  @Debounce()
  public getCommissionStrategyList(data: any, page) {
    return this.netService.send({
      server: domainService.commissionStrategyController.getCommissionStrategyList,
      data,
      page
    })
  }

  /**
   * 委外佣金策略删除
   */
  public delCommissionStrategy(data: any) {
    return this.netService.send({
      server: domainService.commissionStrategyController.delCommissionStrategy,
      data,
      loading: true
    })
  }

  /**
   * 委外佣金策略详情
   */
  public getCommissionDetailsById(data: any) {
    return this.netService.send({
      server: domainService.commissionStrategyController.getCommissionDetailsById,
      data
    })
  }

  /**
   * 委外佣金策略新增
   */
  public insertCommissionStrategy(data: any) {
    return this.netService.send({
      server: domainService.commissionStrategyController.insertCommissionStrategy,
      data,
      loading: true
    })
  }

 

  /**
   * 委外佣金策略下拉列表
   */
  public selectCommissionStrategyList() {
    return this.netService.send({
      server: domainService.commissionStrategyController.selectCommissionStrategyList
    })
  }

  /**
   * 委外佣金策略编辑
   */
  public editCommissionStrategy(data: any) {
    return this.netService.send({
      server: domainService.commissionStrategyController.editCommissionStrategy,
      data
    })
  }



}
